\hypertarget{interface_tic_tac_model}{
\section{TicTacModel Class Reference}
\label{interface_tic_tac_model}\index{TicTacModel@{TicTacModel}}
}


The data model for the tic tac game itself.  


{\ttfamily \#import $<$TicTacModel.h$>$}\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
(int) -\/ \hyperlink{interface_tic_tac_model_aea082b3ec6d74e76190f9f98299f8084}{getPlayerAtX:andY:}
\begin{DoxyCompactList}\small\item\em Gets the player code for the supplied x and y position. \item\end{DoxyCompactList}\item 
(void) -\/ \hyperlink{interface_tic_tac_model_a0fe689db706cd1d42d610d5e42b31b8c}{setPlayerAtX:andY:withPlayer:error:}
\begin{DoxyCompactList}\small\item\em Sets the player code for the supplied x and y position. \item\end{DoxyCompactList}\item 
(bool) -\/ \hyperlink{interface_tic_tac_model_a5e323b154cb6b14a24d056defad2d988}{isOtherPlayerAtX:andY:andIAm:}
\begin{DoxyCompactList}\small\item\em Helper method. Asks is the other player (but not empty) is at the supplied position. \item\end{DoxyCompactList}\item 
(bool) -\/ \hyperlink{interface_tic_tac_model_a0c560148109aff485963bcc9c9a8a769}{isPositionAvailableAtX:andY:}
\begin{DoxyCompactList}\small\item\em Helper method. Asks is the supplied position is available to use. \item\end{DoxyCompactList}\item 
(int) -\/ \hyperlink{interface_tic_tac_model_aac442956dd4a7a37dec26bb0e03e94d3}{getAnyWinner}
\begin{DoxyCompactList}\small\item\em Gets the player code for the first winner detected in the model. \item\end{DoxyCompactList}\item 
\hypertarget{interface_tic_tac_model_ada7dfd6f5a2242619bddd919b920619d}{
(void) -\/ \hyperlink{interface_tic_tac_model_ada7dfd6f5a2242619bddd919b920619d}{debugDumpModel}}
\label{interface_tic_tac_model_ada7dfd6f5a2242619bddd919b920619d}

\begin{DoxyCompactList}\small\item\em Internal, do not use. \item\end{DoxyCompactList}\item 
\hypertarget{interface_tic_tac_model_aebb65530e20e5d63d07574e0dcafd776}{
(void) -\/ \hyperlink{interface_tic_tac_model_aebb65530e20e5d63d07574e0dcafd776}{clear}}
\label{interface_tic_tac_model_aebb65530e20e5d63d07574e0dcafd776}

\begin{DoxyCompactList}\small\item\em Clears the model, setting all positions to be TICTAC\_\-NOBODY. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Attributes}
\begin{DoxyCompactItemize}
\item 
int \hyperlink{interface_tic_tac_model_aa1164c758b4048ee4e609c2a3032e9b3}{playingTable} \mbox{[}3\mbox{]}\mbox{[}3\mbox{]}
\end{DoxyCompactItemize}


\subsection{Detailed Description}
The data model for the tic tac game itself. 

\subsection{Member Function Documentation}
\hypertarget{interface_tic_tac_model_aac442956dd4a7a37dec26bb0e03e94d3}{
\index{TicTacModel@{TicTacModel}!getAnyWinner@{getAnyWinner}}
\index{getAnyWinner@{getAnyWinner}!TicTacModel@{TicTacModel}}
\subsubsection[{getAnyWinner}]{\setlength{\rightskip}{0pt plus 5cm}-\/ (int) getAnyWinner }}
\label{interface_tic_tac_model_aac442956dd4a7a37dec26bb0e03e94d3}


Gets the player code for the first winner detected in the model. \begin{DoxyReturn}{Returns}
the player code of the winner, TICTAC\_\-NOBODY if nobody won. 
\end{DoxyReturn}
\hypertarget{interface_tic_tac_model_aea082b3ec6d74e76190f9f98299f8084}{
\index{TicTacModel@{TicTacModel}!getPlayerAtX:andY:@{getPlayerAtX:andY:}}
\index{getPlayerAtX:andY:@{getPlayerAtX:andY:}!TicTacModel@{TicTacModel}}
\subsubsection[{getPlayerAtX:andY:}]{\setlength{\rightskip}{0pt plus 5cm}-\/ (int) getPlayerAtX: (int) {\em x}\/ andY: (int) {\em y}}}
\label{interface_tic_tac_model_aea082b3ec6d74e76190f9f98299f8084}


Gets the player code for the supplied x and y position. 
\begin{DoxyParams}{Parameters}
\item[{\em x}]the grid x position (0-\/2) \item[{\em y}]the grid y position (0-\/2) \end{DoxyParams}
\begin{DoxyReturn}{Returns}
the player code for the position (TICTAC\_\-NOBODY, TICTAC\_\-X, or TICTAC\_\-O ) 
\end{DoxyReturn}
\hypertarget{interface_tic_tac_model_a5e323b154cb6b14a24d056defad2d988}{
\index{TicTacModel@{TicTacModel}!isOtherPlayerAtX:andY:andIAm:@{isOtherPlayerAtX:andY:andIAm:}}
\index{isOtherPlayerAtX:andY:andIAm:@{isOtherPlayerAtX:andY:andIAm:}!TicTacModel@{TicTacModel}}
\subsubsection[{isOtherPlayerAtX:andY:andIAm:}]{\setlength{\rightskip}{0pt plus 5cm}-\/ (bool) isOtherPlayerAtX: (int) {\em x}\/ andY: (int) {\em y}\/ andIAm: (int) {\em playerCode}}}
\label{interface_tic_tac_model_a5e323b154cb6b14a24d056defad2d988}


Helper method. Asks is the other player (but not empty) is at the supplied position. 
\begin{DoxyParams}{Parameters}
\item[{\em x}]the grid x position (0-\/2) \item[{\em y}]the grid y position (0-\/2) \item[{\em playerCode}]the player code of the caller (TICTAC\_\-NOBODY, TICTAC\_\-X, or TICTAC\_\-O ) \end{DoxyParams}
\begin{DoxyReturn}{Returns}
Whether or not the other player is at the indicated position. 
\end{DoxyReturn}
\hypertarget{interface_tic_tac_model_a0c560148109aff485963bcc9c9a8a769}{
\index{TicTacModel@{TicTacModel}!isPositionAvailableAtX:andY:@{isPositionAvailableAtX:andY:}}
\index{isPositionAvailableAtX:andY:@{isPositionAvailableAtX:andY:}!TicTacModel@{TicTacModel}}
\subsubsection[{isPositionAvailableAtX:andY:}]{\setlength{\rightskip}{0pt plus 5cm}-\/ (bool) isPositionAvailableAtX: (int) {\em x}\/ andY: (int) {\em y}}}
\label{interface_tic_tac_model_a0c560148109aff485963bcc9c9a8a769}


Helper method. Asks is the supplied position is available to use. 
\begin{DoxyParams}{Parameters}
\item[{\em x}]the grid x position (0-\/2) \item[{\em y}]the grid y position (0-\/2) \end{DoxyParams}
\begin{DoxyReturn}{Returns}
Whether or not the position is available. 
\end{DoxyReturn}
\hypertarget{interface_tic_tac_model_a0fe689db706cd1d42d610d5e42b31b8c}{
\index{TicTacModel@{TicTacModel}!setPlayerAtX:andY:withPlayer:error:@{setPlayerAtX:andY:withPlayer:error:}}
\index{setPlayerAtX:andY:withPlayer:error:@{setPlayerAtX:andY:withPlayer:error:}!TicTacModel@{TicTacModel}}
\subsubsection[{setPlayerAtX:andY:withPlayer:error:}]{\setlength{\rightskip}{0pt plus 5cm}-\/ (void) setPlayerAtX: (int) {\em x}\/ andY: (int) {\em y}\/ withPlayer: (int) {\em player}\/ error: (NSError$\ast$$\ast$) {\em error}}}
\label{interface_tic_tac_model_a0fe689db706cd1d42d610d5e42b31b8c}


Sets the player code for the supplied x and y position. 
\begin{DoxyParams}{Parameters}
\item[{\em x}]the grid x position (0-\/2) \item[{\em y}]the grid y position (0-\/2) \item[{\em player}]code for the position (TICTAC\_\-NOBODY, TICTAC\_\-X, or TICTAC\_\-O ) \item[{\em error}]A return NSError in the event something bad happens (such as the position is not available) \end{DoxyParams}


\subsection{Member Data Documentation}
\hypertarget{interface_tic_tac_model_aa1164c758b4048ee4e609c2a3032e9b3}{
\index{TicTacModel@{TicTacModel}!playingTable@{playingTable}}
\index{playingTable@{playingTable}!TicTacModel@{TicTacModel}}
\subsubsection[{playingTable}]{\setlength{\rightskip}{0pt plus 5cm}-\/ (int {\bf playingTable}\mbox{[}3\mbox{]}\mbox{[}3\mbox{]})\hspace{0.3cm}{\ttfamily  \mbox{[}protected\mbox{]}}}}
\label{interface_tic_tac_model_aa1164c758b4048ee4e609c2a3032e9b3}
The tic tac grid is just a simple two dimensional c array. 

The documentation for this class was generated from the following files:\begin{DoxyCompactItemize}
\item 
TicTacModel.h\item 
TicTacModel.m\end{DoxyCompactItemize}
